package com.xsmart.goods;

import com.xsmart.goods.init.ServicesDiscoveryInit;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

public class ApplicationStartup implements ApplicationListener<ContextRefreshedEvent> {


    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        //初始化服务
        ServicesDiscoveryInit servicesDiscoveryInit = event.getApplicationContext().getBean("servicesDiscoveryInit", ServicesDiscoveryInit.class);
        servicesDiscoveryInit.initServicesDiscovery();
    }
}
